﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/SiteWithControlAccess.Master"
    Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<%@ Import Namespace="ProjetoComperio.DataLayer.Entities" %>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">
        //
        //adding the corner shape to divs
        //

        $("#divRecentProjects").corner();
        $("#divRecentEvents").corner();
        $("#divRecentEducationalITApplications").corner();
        $("#comperioNews").corner();

    </script>
    <h2>
        Seja Bem Vindo!
    </h2>
    <style>
        .center
        {
            margin-left: auto;
            margin-right: auto;
        }
    </style>
    <table class="center" width="55%">
        <tr>
            <td>
            <label class="Textboxlabel"> Últimos projetos cadastrados </label>
               
                <br />
                <div id="divRecentProjects" style="background-color: #E5E5E5; width: 300px; overflow: auto;
                    height: 200px; border: 1px solid #666; float: left;">
                    <% 
                        if (ViewData["RecentProjectsList"] == null)
                            Html.DisplayText("Não há projetos cadastrados recentemente");
                        else
                            foreach (var recentProject in ViewData["RecentProjectsList"] as IQueryable<Project>)
                            { %>
                    <%= Html.ActionLink(recentProject.Title, "../Project/Visualize", new { id = URLEncrypt.EncryptToString(recentProject.ContributionID.ToString()) })%>
                    <br />
                    <%} %>
                </div>
            </td>
            <td>
              <label class="Textboxlabel">  Últimos eventos cadastrados </label>
                <br />
                <div id="divRecentEvents" style="background-color: #E5E5E5; width: 300px; overflow: auto;
                    height: 200px; border: 1px solid #666; float: left;">
                    <% 
                        foreach (var recentEvent in ViewData["RecentEventsList"] as IQueryable<Event>)
                        {   
                    %>
                    <%= Html.ActionLink(recentEvent.Title, "../Event/Visualize", new { id = URLEncrypt.EncryptToString(recentEvent.ContributionID.ToString()) })%>
                    <br />
                    <%} %>
                </div>
            </td>
        </tr>
        <tr>
            <td>
              <label class="Textboxlabel">  Aplicações educacionais </label>
                <br />
                <div id="divRecentEducationalITApplications" style="background-color: #E5E5E5; width: 300px;
                    overflow: auto; height: 200px; border: 1px solid #666; float: left; margin-left: 0px;">
                    <% 
                        foreach (var recentEducationalITApplication in ViewData["RecentEducationalITApplicationsList"] as IQueryable<EducationalITApplication>)
                        {   
                    %>
                    <%= Html.ActionLink(recentEducationalITApplication.Title, "../EducationalITApplication/Visualize", new { id = URLEncrypt.EncryptToString(recentEducationalITApplication.ContributionID.ToString()) })%>
                    <br />
                    <%} %>
                </div>
            </td>
            <td>
              <label class="Textboxlabel">  Novidades do Comperio </label>
                <br />
                <div id="comperioNews" style="background-color: #E5E5E5; width: 300px; overflow: auto;
                    height: 200px; border: 1px solid #666; float: left;">
                </div>
            </td>
        </tr>
    </table>
    <br />
    <br />
</asp:Content>
